import { _decorator, Component, Node, Label } from "cc";
const { ccclass, property } = _decorator;

@ccclass("Prefabs/Tooltip")
export class Tooltip extends Component {
    @property(Node)
    private label: Node = null;

    show(msg = "") {
        this.label.getComponent(Label).string = msg;
        this.node.active = true;
        setTimeout(() => {
            this.node.active = false;
        }, 2000);
    }
}
